Views [dbo].[vCashGifts]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Created3:38:37 PM Friday, January 07, 2011
Last Modified1:48:32 PM Thursday, September 22, 2011
Columns
Name
ID
GIFT_AMOUNT
Permissions
TypeActionOwning Principal
GrantDeleteIMIS
GrantInsertIMIS
GrantReferencesIMIS
GrantSelectIMIS
GrantUpdateIMIS
SQL Script
create  view vCashGifts as
   select t.BT_ID as ID,
               sum(t.INVOICE_CREDITS) as GIFT_AMOUNT
    from Trans t, Invoice i
    where  t.INVOICE_REFERENCE_NUM = i.REFERENCE_NUM and
                i.SOURCE_SYSTEM = 'FR' and
                t.CHECK_NUMBER NOT IN
                   (select Cash_Accounts.CASH_ACCOUNT_CODE
                    from Cash_Accounts  
                    where Cash_Accounts.ACCOUNT_TYPE = 2) and
                          ((t.JOURNAL_TYPE = 'PAY' and t.TRANSACTION_TYPE = 'AR') or
                            (t.JOURNAL_TYPE = 'IN' and t.TRANSACTION_TYPE = 'PAY'))
  group by t.BT_ID

GO
GRANT REFERENCES ON  [dbo].[vCashGifts] TO [IMIS]
GRANT SELECT ON  [dbo].[vCashGifts] TO [IMIS]
GRANT INSERT ON  [dbo].[vCashGifts] TO [IMIS]
GRANT DELETE ON  [dbo].[vCashGifts] TO [IMIS]
GRANT UPDATE ON  [dbo].[vCashGifts] TO [IMIS]
GO
Uses